package com.oauth.global.client.ui.extension;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class MainPanel extends Composite {

	private static MainPanelUiBinder uiBinder = GWT.create(MainPanelUiBinder.class);

	interface MainPanelUiBinder extends UiBinder<Widget, MainPanel> {
	}

	private static final ExtensionConstant extConstants = GWT.create(ExtensionConstant.class);
	
	@UiField
	Label chromeName;

	@UiField
	Label chromeDescription;

	@UiField
	Image chromeImage;

	@UiField
	ExtensionPanel birthdayExt;

	@UiField
	ExtensionPanel statusExt;

	public MainPanel() {
		initWidget(uiBinder.createAndBindUi(this));
		ExtensionResources res = ExtensionResources.INSTANCE;
		chromeName.setText(extConstants.chromeName());
		chromeDescription.setText(extConstants.chromeDescription());
		chromeImage.setUrl(res.chromeIcon().getURL());

		birthdayExt.setDetails(extConstants.birthdayName(), extConstants.birthdayDescription(),
				res.birthdayIcon().getURL(), extConstants.birthdayExtUrl());
		statusExt.setDetails(extConstants.statusName(), extConstants.statusDescription(),
				res.statusIcon().getURL(), extConstants.statusExtUrl());
	}

}
